const Router = require('koa-router');
const router = new Router();
const {db, Op, QueryTypes} = require("../../models/db");
// 商品历史价格
router.post('/bill/getIdByNo', async ctx => {
    let user = ctx.user
    let billNo = ctx.request.body.billNo
    let tenantId = user.tenantId;
    let model = await db.models['invoice'].findOne({
        where: {
            tenantId,
            billNo,
        },
    })
    if(!model) return ctx.err('没找到单据')
    return ctx.suc('', model.transType+'-'+model.id)

})

module.exports = router;